#include<iostream>
using namespace std;

int n;
int now;

int main(){
	cin>>n;
	for(int i=n;i>1;i--){//^n-2
		cin>>now;
		if(now==1 && i==n)cout<<"x^"<<n;
		else if(now==-1 && i==n)cout<<"-x^"<<n;
		else if(now==-1)	cout<<"-"<<"x^"<<i;
		else if(now<0 || i==n)	cout<<now<<"x^"<<i;
		else if(now==1)	cout<<"+"<<"x^"<<i;
		else if(now>0)	cout<<"+"<<now<<"x^"<<i;
	}
	
	cin>>now;//^1
	if(now==-1)	cout<<"-"<<"x";
	else if(now<0)	cout<<now<<"x";
	else if(now==1)	cout<<"+"<<"x";
	else if(now>0)	cout<<"+"<<now<<"x";
	
	cin>>now;//^0
	if(now<0)	cout<<now<<endl;
	else if(now>0)	cout<<"+"<<now<<endl;
	return 0;
}
